function loadmore(start,limit)
{
	$.ajax({
		type: "POST",
		url: "controllers/articles_controller.php",
		data: {action:'show',start:start,limit:limit},
		success: function(msg){
					$("#loadmore").remove()
			    	$("#page").append($(msg).hide().fadeIn())
		}
	});
}

function setCited(note_id,is_used)
{
	$.ajax({
		type: "POST",
		url: "controllers/articles_controller.php",
		data: {action:'set_cited', id:note_id, cited:is_used},
		success: function(msg){
			// reload article title
			reloadArticleTitle(note_id)
		}
	 });
}

function addTag(article_id,tag)
{
	$('#debug').html("adding tag...")
	$.ajax({
		type: "POST",
		url: "controllers/articles_controller.php",
		data: {action:'add_tag', id:article_id, tag:tag},
		success: function(msg){
			// reload article title
			reloadArticleTitle(article_id)
		}
	 });
}

function reloadArticleTitle(id)
{
	$.ajax({
		type: "POST",
		url: "controllers/articles_controller.php",
		data: {action:'show_title', id:id},
		success: function(msg){
			$('#article_title_'+id).fadeOut()
			$('#article_title_'+id).html(msg)
			$('#article_title_'+id).fadeIn()
		}
	 });
}

function articleToggleBody(param,arrow)
{
	
	$(arrow).toggleClass('arrow_up').toggleClass('arrow_down')		
	toggle_slide(param)
}